"""
_*_ : utf-8 _*_ 
@Time: 2023/11/18 21:07
@Author: LWK
@File: 083_requests
@Project: demo01
"""
import requests
import json

url = 'https://fanyi.baidu.com/sug'

headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) '
                  'Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76'
}

param = {
    'kw': 'dog'
}

res = requests.post(url=url, data=param, headers=headers)
context = res.text

print(context)

# jsonText = json.loads(context, encodings='utf-8')
jsonText = json.loads(context)

print(jsonText)